<template>
  <div class="user">
    <page-search
      :searchFormConfig="searchFormConfig"
      @resetClick="handleResetClick"
      @queryClick="handleQueryClick"
    ></page-search>
    <page-content
      ref="pageContentRef"
      pageName="users"
      @newBtnClick="handleNewData"
      :contentTableConfig="contentTableConfig"
    ></page-content>
  </div>
</template>
<script lang="ts" setup>
import PageSearch from '@/components/page-search'
import PageContent from '@/components/page-content'
import { searchFormConfig } from './config/search.config'
import { contentTableConfig } from './config/content.config'
import { ref } from 'vue'

const pageContentRef = ref<InstanceType<typeof PageContent>>()

const handleResetClick = () => {
  pageContentRef.value?.getPageData()
}

const handleQueryClick = (formData: any) => {
  pageContentRef.value?.getPageData(formData)
}

const handleNewData = () => {
  console.log('new')
}
</script>
